package com.xl.observer.jre;

import java.util.Observable;
import java.util.Observer;

public class WeatherObserver implements Observer {

    private String observerName;

    public String getObserverName() {
        return observerName;
    }

    public void setObserverName(String observerName) {
        this.observerName = observerName;
    }

    @Override
    public void update(Observable o, Object arg) {
        System.out.println(observerName + "  收到消息 目标推送的消息是  " + arg);

        System.out.println(observerName + "  收到消息 主动到对象中拉内容是  " + ((WeatherSubject)o).getContent());
    }
}
